<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="./layui/css/layui.css">
</head>
<body>

<table class="layui-table" lay-data="{height: 313, data:[{id:2,username:'张三',score:20,wealth:'6666'}], initSort: {field:'wealth', type:'desc'}}" lay-filter="demoEvent">
    <thead>
        <tr>
            <th lay-data="{field:'id', width:80}">ID</th>
            <th lay-data="{field:'username', width:80}">用户名</th>
            <th lay-data="{field:'score', width:80, sort: true}">评分</th>
            <th lay-data="{field:'wealth', sort: true, minWidth: 150}">财富</th>
        </tr>
    </thead>
</table> 


<script type="text/javascript" src="./layui/layui.js"></script>
<script>
layui.use('table', function(){
var table = layui.table; 
});
</script>

</body>
</html>